"""
desc: fbs 启动文件
author: mr_52hz
date: 2021-03-10
"""
import sys

from PyQt5.QtCore import QCoreApplication, Qt
from fbs_runtime.application_context.PyQt5 import ApplicationContext

import settings
from UI.main import QuickReName


if __name__ == '__main__':
    # 适配更高分辨率
    QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
    appctxt = ApplicationContext()
    # fbs 获取qss 需要拷贝src/main/resources/base/
    # https://github.com/mherrmann/fbs-tutorial
    icon_path = appctxt.get_resource('icon.png')
    light_qss = appctxt.get_resource('main-light.qss')
    night_qss = appctxt.get_resource('main-night.qss')
    app = appctxt.app
    settings.to_height_w_h_screen(app.desktop().width(), app.desktop().height())
    window = QuickReName(icon=icon_path, light=light_qss, night=night_qss)
    sys.exit(app.exec())
